package com.maisuiit.factory.schemes02.service.impl;

import com.maisuiit.factory.schemes01.entity.SmallGiftInfo;
import com.maisuiit.factory.schemes02.entity.AwardInfo;
import com.maisuiit.factory.schemes02.entity.ResponseResult;
import com.maisuiit.factory.schemes02.service.IFreeGoods;

import java.util.UUID;

/**
 * 小礼品发放服务
 * @author: zhangcc
 * @date: 2024/02/20
 */
public class SmallGiftServiceImpl implements IFreeGoods {

    public ResponseResult sendFreeGoods(AwardInfo awardInfo) {
        SmallGiftInfo smallGiftInfo = new SmallGiftInfo();
        smallGiftInfo.setUserPhone(awardInfo.getExtMap().get("phone"));
        smallGiftInfo.setUserName(awardInfo.getExtMap().get("username"));
        smallGiftInfo.setAddress(awardInfo.getExtMap().get("address"));
        smallGiftInfo.setOrderId(UUID.randomUUID().toString());
        System.out.println("小礼品发放成,请注意查收: " + smallGiftInfo);
        return new ResponseResult("200","小礼品发送成功",smallGiftInfo);
    }
}
